import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  //创建路由,配置模式
  //vite中的环境变量 import.meta.env.BASE_URL
  history: createWebHistory(import.meta.env.BASE_URL),
  //往routes中添加路由规则
  routes: [
    { path:'/' ,component:()=>import('@/views/LayoutContainer.vue'),
      redirect:'/index',
      children:[
        {
        path:'/index', component:()=>import('@/views/IndexPage.vue') },
        {
        path:'/category',
        component:()=>import('@/views/CatSpecies.vue')
      },
        {
        path:'/catinfo',
        component:()=>import('@/views/CatManagement.vue')
      }
      ]

    }
  ],
})

export default router
